﻿<%@ Page Title="" Language="C#" MasterPageFile="~/QuanLyDuoc/HeThongTaiChinh/ThanhToanHoaDon/Master_ThanhToanHoaDon.master" AutoEventWireup="true" CodeBehind="ThanhToanPhieuYeuCauXuatVatTu.aspx.cs" Inherits="HospitalManager.QuanLyDuoc.HeThongTaiChinh.ThanhToanHoaDon.ThanhToanPhieuYeuCauXuatVatTu" %>

<%@ Register Src="~/QuanLyDuoc/HeThongNhapXuat/PhieuYeuCauXuatVatTu/uc_ViewPhieu.ascx" TagName="uc_ViewPhieu" TagPrefix="uc2" %>
<asp:Content ID="Content3" ContentPlaceHolderID="TopContent_ThanhToanHoaDon" runat="server">
    <h1 style="font-size: 30px; margin: 0;">
        <small class="breadcrumb" style="background-color: #ffffff; font-size: 50%; padding: 0 20px;">
            <li><a href="/QuanLyDuoc/HeThongTaiChinh/HeThongTaiChinh.aspx">HỆ THỐNG TÀI CHÍNH</a></li>
            <li class="active">THANH TOÁN HÓA ĐƠN</li>
            <li class="active">Hóa đơn phiếu yêu cầu xuất vật tư</li>
        </small>
    </h1>
</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent_ThanhToanHoaDon" runat="server">
    <div class="row">
        <div class="form-horizontal">
            <div class="col-xs-4 col-md-4">
                <asp:DropDownList ID="ddlKho_Khoa" runat="server" ClientIDMode="Static">
                </asp:DropDownList>
            </div>
            <div class="col-xs-6 col-md-6">
                <div class="input-group">
                    <span class="input-group-addon">Từ ngày</span>
                    <asp:TextBox ID="txtTuNgay" ClientIDMode="Static" runat="server" CssClass="form-control ipdate dateFormat"
                        placeholder="Từ ngày"></asp:TextBox>
                    <span class="input-group-addon" style="border-right: 0;">đến ngày</span>
                    <asp:TextBox ID="txtDenNgay" ClientIDMode="Static" runat="server" CssClass="form-control ipdate dateFormat"
                        placeholder="Đến ngày"></asp:TextBox>
                </div>
            </div>
            <div class="col-xs-2 col-md-2">
                <asp:Button ID="btnTimKiem" ClientIDMode="Static" runat="server" Text="Tìm kiếm" CssClass="btn btn-default"
                    OnClientClick="validationform_Timkiem()" OnClick="btnTimKiem_Click" />
            </div>
        </div>
    </div>
    <div class="row" style="margin-top: 10px;">
        <div class="col-md-12">
            <div class="form-group table-responsive">
                <asp:GridView ID="gvPhieuYeuCauXuatVatTu" runat="server" AutoGenerateColumns="False" Width="100%"
                    CssClass="table table-bordered table-condensed" DataKeyNames="MaPhieu" OnRowDataBound="gvPhieuYeuCauXuatVatTu_RowDataBound">
                    <Columns>
                        <asp:BoundField DataField="RowNumber" HeaderText="STT">
                            <ItemStyle HorizontalAlign="Center"></ItemStyle>
                        </asp:BoundField>
                        <asp:BoundField DataField="NgayYeuCau" HeaderText="Ngày yêu cầu" DataFormatString="{0:dd-MM-yyyy}">
                            <ItemStyle HorizontalAlign="Center"></ItemStyle>
                        </asp:BoundField>
                        <asp:BoundField DataField="NguoiYeuCau" HeaderText="Người yêu cầu"></asp:BoundField>
                        <asp:BoundField DataField="TenKhoYeuCau" HeaderText="Kho yêu cầu"></asp:BoundField>
                        <asp:BoundField DataField="TenKhoXuat" HeaderText="Kho xuất"></asp:BoundField>
                        <asp:BoundField DataField="TongThuoc" HeaderText="Tổng thuốc" DataFormatString="{0:n0}">
                            <ItemStyle HorizontalAlign="Right"></ItemStyle>
                        </asp:BoundField>
                        <asp:TemplateField>
                            <ItemTemplate>
                                <asp:LinkButton ID="btnViewPhieuYeuCauXuatVatTu" runat="server" ToolTip="Xem thông tin phiếu"
                                    CssClass="btn btn-success" maphieu='<%# Eval("MaPhieu") %>' OnClientClick="viewphieuyeucauxuatvattu(this);" href="javascript:void(0)">
                                    <i class="glyphicon glyphicon-search"></i>
                                </asp:LinkButton>
                                <asp:LinkButton ID="btnDuyetPhieuYeuCauXuatVatTu" runat="server" ToolTip="Duyệt phiếu"
                                    CssClass="btn btn-info" CommandArgument='<%# Eval("MaPhieu") %>'
                                    OnClick="btnDuyetPhieuYeuCauXuatVatTu_Click">
                                    <i class="glyphicon glyphicon-check"></i>
                                </asp:LinkButton>
                                <div class="btn-group dropup" id="dd-TraPhieuYeuCauXuatVatTu">
                                    <asp:LinkButton ID="btnDropDownTraLaiPhieuYeuCauXuatVatTu" runat="server" ToolTip="Trả lại phiếu"
                                        CssClass="btn btn-danger dropdown-toggle" data-toggle="dropdown" aria-expanded="false" OnClientClick="$('.dropdown-menu-form').find('input:text').val('');">
                                        <i class="glyphicon glyphicon-share"></i>
                                    </asp:LinkButton>
                                    <ul class="dropdown-menu dropdown-menu-right dropdown-menu-form" role="menu" style="width: 460px;">
                                        <li>
                                            <div class="col-xs-12 col-md-12" style="margin-top: 10px;">
                                                <div class="form-horizontal">
                                                    <div class="form-group">
                                                        <label class="col-sm-2 control-label">
                                                            Lý do</label>
                                                        <div class="col-sm-10">
                                                            <asp:TextBox ID="txtGhiChu" runat="server" CssClass="form-control"></asp:TextBox>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </li>
                                        <li>
                                            <div class="col-xs-12 col-md-12">
                                                <div class="form-horizontal">
                                                    <div class="form-group">
                                                        <div class="col-sm-offset-2 col-sm-10">
                                                            <asp:LinkButton ID="btnTraLaiPhieuYeuCauXuatVatTu" runat="server" Text="Chấp nhận"
                                                                CssClass="btn btn-success" CommandArgument='<%# Eval("MaPhieu") %>'
                                                                OnClick="btnTraLaiPhieuYeuCauXuatVatTu_Click">
                                                            </asp:LinkButton>
                                                            <asp:LinkButton ID="btnThoat" runat="server" Text="Thoát" CssClass="btn btn-danger"
                                                                OnClientClick="$('.dropdown-menu-form').parent().removeClass('open');" href="javascript:void(0)"></asp:LinkButton>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </li>
                                    </ul>
                                </div>
                            </ItemTemplate>
                            <ItemStyle HorizontalAlign="Center" Width="15%" />
                        </asp:TemplateField>
                    </Columns>
                </asp:GridView>
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col-md-6">
        </div>
        <div class="col-md-6" style="text-align: right;">
            <asp:DataList RepeatDirection="Horizontal" runat="server" ID="dlPager" OnItemCommand="dlPager_ItemCommand"
                CssClass="tbPage">
                <ItemTemplate>
                    <asp:LinkButton Enabled='<%#Eval("Enabled") %>' runat="server" ID="lnkPageNo" Text='<%#Eval("Text") %>'
                        CommandArgument='<%#Eval("Value") %>' CommandName="PageNo"></asp:LinkButton>
                </ItemTemplate>
            </asp:DataList>
        </div>
    </div>
    <asp:HiddenField ID="hfPageIndex" runat="server" Value="1" />
    <script type="text/javascript">
        $(function () {
            $(".dropdown-menu-form").on("click", function (e) {
                $(this).find("input:text:first").focus();
                e.stopPropagation();
            });
        });
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="FormContent_ThanhToanHoaDon" runat="server">
    <div id="div_phieuyeucauxuatvattu_view" class="modal fade" tabindex="-1" role="dialog" data-backdrop="static"
        data-width="98%" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" style="line-height: 1;">
                        <span>&times;</span><span class="sr-only">Close</span></button>
                    <h4 class="modal-title">Phiếu yêu cầu xuất vật tư</h4>
                </div>
                <div class="modal-body modal-fullheight">
                    <uc2:uc_ViewPhieu ID="uc_ViewPhieu4" runat="server" />
                </div>
            </div>
        </div>
    </div>
</asp:Content>